clear all

*set working directory
use "study1_data.dta"


***********************
* manipulation checks *
***********************

xtset ID

*moralization
xtreg moral treat* i.issue, vce(cluster ID)

*moralization by extremity condition
xtreg moral treatmoral i.issue if treatextreme==0, vce(cluster ID)
xtreg moral treatmoral i.issue if treatextreme==1, vce(cluster ID)

*extremity - national public
xtreg reppublic treat* i.issue, vce(cluster ID)

*extremity - national public - by morality condition
xtreg reppublic treatextreme i.issue if treatmoral==0, vce(cluster ID)
xtreg reppublic treatextreme i.issue if treatmoral==1, vce(cluster ID)

*extremity - co-partisans
xtreg reppartisans treat* i.issue, vce(cluster ID)


************
* analysis *
************

*belief dv by issue
tab believes issue, col

*change dv by issue
tab change issue, col

*correlation between dvs
polychoric believes change

*belief dv
xtreg believes treat* i.issue, vce(cluster ID)
est store believe

*change dv 
xtreg change01 treat* i.issue, vce(cluster ID)
est store change

*combined dv
xtreg cred01 treat* i.issue, vce(cluster ID)
est store cred

*figure 1
coefplot change, keep(treatmoral treatextreme) bylabel("Won't Change Position") || believe, keep(treatmoral treatextreme) bylabel("Really Believes Position") || cred, keep(treatmoral treatextreme) bylabel("Sincerity Index") xline(0) byopts(cols(1)) xlab(-.05(.05).15) rename(treatextreme="Extreme Stance" treatmoral="Moral Stance")

*interactive model
xtreg cred01 i.cond i.issue, vce(cluster ID)
test 2.cond=1.cond
